﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;

namespace CCF20Module
{
    public class ModuleSelector : DataTemplateSelector
    {
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            //DemoMode mode = (DemoMode)item;

            // return (DataTemplate) ((Control)container).Resources[Enum.GetName(typeof(DemoMode), mode)];
            DataTemplate myTemp = (DataTemplate)((Control)container).Resources[(string)item];
            //UserControl myControl = myTemp.FindName(
            
            return (DataTemplate)((Control)container).Resources[(string)item];
        }
    }
}
